<script>
  var interval_id;
  var delta_x=10;
  var delta_y=10;
  var x_maximum=screen.availWidth;
  var y_maximum=screen.availHeight-30;
  var x_position=100;
  var y_position=100;
  //moveTo(1300,1200);
  interval_id=setInterval("move_window()",50);

  function move_window()
  {
    //moveBy(delta_x,delta_y);
    resizeBy(delta_x,delta_y);
    x_position+=delta_x;
    y_position+=delta_y;

    if(x_position >=x_maximum || x_position<=100)
    {
      delta_x=-delta_x;
    }
    if(y_position >= y_maximum || y_position <=100)
    {
      delta_y=-delta_y;
    }
  }
</script>
